package com.zxh.zhenxihuan.controller;

import com.zxh.zhenxihuan.service.MerchantService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class MerchantController {
    //http://localhost:8080/getPage.html?pageNum=1&pageCount=5
    @Resource
    private MerchantService merchantService;
    @PostMapping("/find_address")
    public int[] find_address(){
        int[] arr={5, 20, 36, 10, 10, 20};
        return arr;
    }
    @PostMapping("getPage")
    public Map<String,Object> getPage(@RequestBody Map map){
        Integer pageNum=(Integer)map.get("pageNum");
        Integer pageCount=(Integer)map.get("pageCount");
        return merchantService.getPage(pageNum,pageCount);
    }


}
